<template>
  <div>
    <AdminFinance v-slot="info">
      <input type="button" @click="del(info.id)" value="删除" class="btn btn-warning">
    </AdminFinance>
  </div>
</template>

<script setup lang="ts">
import AdminFinance from './AdminFinance.vue'
import axios from 'axios'

const del=(F_id:any)=>{
  if(confirm("确定要删除么?")){
    axios({
    url:'http://localhost:59121/api/Finance/GetDeleteFinance',
    method:'get',
    params:{
      F_id:F_id
    }
  })
  .then(res=>{
    if(res.data>0){
      alert("删除成功")
      location.href='/SloatDelete'
    }else{
      alert("删除失败")
    }
  })
  .catch(err=>{
    console.log(err)
  })
  }
  
}
</script>